#ifndef _MIXP_SKT_SERVER_H
#define _MIXP_SKT_SERVER_H

#include "mixedprocess.h"
#include "core/protocol/mixp_packet.h"

typedef struct gevent gevent_t;

typedef struct mixp_skt_server
{
    int port;
    const char *unixpath;
    int fd;
    struct gevent_base *evbase;
    gevent_t *ev;
    pthread_t tid;

    hash_t *dict_uuid2fd;
    hash_t *dict_fd2client;
} mixp_skt_server_t;

#ifdef __cplusplus
extern "C"
{
#endif

    mixp_skt_server_t *mixp_skt_server_new(int, const char *);
    void mixp_skt_server_free(mixp_skt_server_t *);
    int mixp_skt_server_run(mixp_skt_server_t *);

#ifdef __cplusplus
};
#endif
#endif